@extends('admin::metro.vendor.master')

@section('title')
{{ trans('users.add') }}
@stop

@section('breadcrumb')
<li><a href="#">{{ isset($user) ? trans('users.edit') : trans('users.add') }}</a></li>
@stop

@section('stylesheets')
<link href="{{ URL::asset('select2/select2.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ URL::asset('select2/select2-bootstrap.css') }}" rel="stylesheet" type="text/css" />
@stop

@section('content')
@if(isset($user))
    {!! Form::open(['files'=>true]) !!}
    {!! Form::hidden('_method', 'PUT') !!}
@else
    {!! Form::open(['files'=>true]) !!}
@endif


<div class="accordion" id="accordion2">
    <div class="accordion-group">
        <div class="accordion-heading">
            <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#profile">
                {{ trans('users.profile') }}
            </a>
        </div>
        <div id="profile" class="accordion-body collapse in">
            <div class="accordion-inner row">
                @include('admin::metro.users.profile_form')
            </div>
        </div>
    </div>
    <!-- Avatar -->
    @if(\App\Models\Settings::get('use_avatars'))
    <div class="accordion-group">
        <div class="accordion-heading">
            <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#avatar">
                {{ trans('users.avatar') }}
            </a>
        </div>
        <div id="avatar" class="accordion-body collapse">
            <div class="accordion-inner">
                @include('admin::metro.users.avatar_form')
            </div>
        </div>
    </div>
    @endif
    <div class="accordion-group">
        <div class="accordion-heading">
            <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#settings">
                {{ trans('users.settings') }}
            </a>
        </div>
        <div id="settings" class="accordion-body collapse in">
            <div class="accordion-inner">
                @include('admin::metro.users.settings_form')
            </div>
        </div>
    </div>

    <div class="panel-footer">
    {!! Form::submitButton(trans('temp.save'), 'icon-save', 'class="btn btn-primary"') !!}
    </div>
</div>


{!! Form::close() !!}
@stop

@section('javascripts')
<script src="{{ URL::asset('js/accordion.js') }}"></script>
<script src="{{ URL::asset('select2/select2.min.js') }}"></script>
<script>
$(document).ready(function () {
    $('select.select2-no-search').select2({
        minimumResultsForSearch: -1,
        width: '100%',
        placeholder: '{{ trans("users.select_role") }}'
    });
});
</script>
@stop